package com.fetch.test;


import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.PostMethod;

public class Login {
	
	public static void main(String[] args) {

		String COOKIE = "ASP.NET_SessionId=hit2zn45x4nqhd55frtschrc";
		HttpClient client = new HttpClient();
		PostMethod postMethod = null;
		try{
			postMethod = new PostMethod("http://218.4.189.213:8001/login.aspx");
			postMethod.addParameter("__EVENTTARGET", "");
			postMethod.addParameter("__EVENTARGUMENT", "");
			postMethod.addParameter("__VIEWSTATE", "/wEPDwUKLTk3ODEzMzIwOWQYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgEFC0ltZ0J0bkxvZ2luMImTN48C3kpzihS3SaNDhe32C7w=");
			postMethod.addParameter("txtMACAddr", "BFEBFBFF000306A9x86+Family+6+Model+58+Stepping+9CPU0Intel+Pentium+III+Xeon+%E5%A4%84%E7%90%86%E5%99%A81363trueGigabyte+Technology+Co.%2C+Ltd.trueH61M-S1To+be+filled+by+O.E.M.x.x+++To+Be+Filled+By+O.E.M.3trueOn+Board+Device+0");
			postMethod.addParameter("login_cardmunber", "001000032944");
			postMethod.addParameter("login_password", "222921165362");
			postMethod.addParameter("ImgBtnLogin.x", "45");
			postMethod.addParameter("ImgBtnLogin.y", "7");
			postMethod.addParameter("TxtVidCode", "PEdZ");
			postMethod.addParameter("__EVENTVALIDATION", "/wEWBQL2sf6tDQL4up+hBgK4zqqrCgK4v/1ZApzAu8gHEgk3rX9oGAGmUoogSSkyPcnfjD4=");
			postMethod.addRequestHeader("Cookie", COOKIE);
			
			client.executeMethod(postMethod);
			String result = postMethod.getResponseBodyAsString();
			System.out.println(result);
		}catch (Exception e) {
			e.printStackTrace();
		}finally{
			postMethod.releaseConnection();
		}
	}
	
}
